package com.mego.tzadd.activitys;

import android.content.Context;
import android.content.SharedPreferences;

import com.google.firebase.messaging.FirebaseMessagingService;
import com.mego.tzadd.utils.Utils;


/**
 * Created by Ravi Tamada on 08/08/16.
 * www.androidhive.info
 */
public class MyFirebaseInstanceIDService extends FirebaseMessagingService {
    private static final String TAG = MyFirebaseInstanceIDService.class.getSimpleName();

    @Override
    public void onNewToken(String token) {

        Utils.log(token);
        SharedPreferences sp = getApplicationContext().getSharedPreferences(
                "tzaddfcm", Context.MODE_PRIVATE);
        SharedPreferences.Editor editor = sp.edit();
        editor.putString("fcmtoken", token);
        editor.commit();

//        sendRegistrationToServer(token);
    }

}

